package container

import (
	"github.com/liyaozong/mengo/common/di"
	"gorm.io/gorm"
)

// DBClientInterfaceName contains the name of the interfaces.DBClient implementation in the DIC.
var DBClientInterfaceName = di.TypeInstanceToName((*gorm.DB)(nil))

// DBClientFrom helper function queries the DIC and returns the interfaces.DBClient implementation.
func DBClientFrom(get di.Get) *gorm.DB {
	return get(DBClientInterfaceName).(*gorm.DB)
}
